package com.arvato.wxwork.service.other;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.arvato.minipro.bean.bean_dto.common.Query;
import com.arvato.wxwork.mapper.other.WxworkCityMapper;
import com.arvato.wxwork.mapper.other.WxworkProvinceMapper;

@Service
@Transactional
public class WxworkProvinceCityService {
	
	@Autowired
	private WxworkCityMapper wxworkCityMapper;
	
	@Autowired
	private WxworkProvinceMapper wxworkProvinceMapper;
	
	/**
	 * 获取省的名称
	 * @param provinceCode
	 * @return
	 */
	public String getProvinceName(String provinceCode) {
		Query query = new Query();
		query.put("provinceCode", provinceCode);
		String provinceName = wxworkProvinceMapper.getProvinceName(query).getSidenm();
		return provinceName;
	}
	
	/**
	 * 获取省的名称
	 * @param provinceCode
	 * @param cityCode
	 * @return
	 */
	public String getCityName(String provinceCode, String cityCode) {
		Query query = new Query();
		query.put("provinceCode", provinceCode);
		query.put("cityCode", cityCode);
		String cityName = wxworkCityMapper.getCityName(query).getAreanm();
		return cityName;
	}
}
